import Vue from 'vue'
import VueRouter from 'vue-router'
// const Home = () => import ('../views/FindMusic/Home.vue')
// const DaySongsRecom = () => import ('../views/FindMusic/DaySongsRecom')
// const PlayListDetail = () => import ('../views/FindMusic/PlayListDetail')
// const Recom = () => import ('../views/FindMusic/Recom')
// const MyFM = () => import ('../views/MyFM/MyFM')
// const Search = () => import ('../views/Search/Search')
// const Songs = () => import ('../views/Search/childView/songs') 
// const Album = () => import ('../views/Album/Album')
// const Artist = () => import ('../views/Artist/Artist')
// const Profile = () => import ('../views/User/Profile')


Vue.use(VueRouter)

  const routes = [
  {
    path: '/',
    name: '/',
    redirect:'/findMusic'
  },
  //发现音乐
  {
    path: '/findMusic',
    name: 'Home',
    component: () => import ('../views/FindMusic/Home.vue'),
    meta:{
      keepAlive:true
    },
    redirect:"/findMusic/recom",
    children:[
      {
        path:'/findMusic/recom',
        name:'Recom',
        component:() => import ('../views/FindMusic/Recom'),
        meta:{
          keepAlive:true
        }
      }
    ]
  },
  // 日推歌曲
  { 
    path:'/daySongsRecom',
    name:'DaySongsRecom',
    component:() => import ('../views/FindMusic/DaySongsRecom'),
    meta:{
      keepAlive:true
    },
  },
  // 歌单详情列表
  {
    path: '/playListDetail',
    name: 'PlayListDetail',
    component: () => import ('../views/FindMusic/PlayListDetail'),
    meta:{
      keepAlive:false
    },
  },
   // 歌手页
   {
    path: '/artist',
    name: 'Artist',
    component: () => import ('../views/Artist/Artist'),
    meta:{
      keepAlive:false
    },
  },

  // 专辑详情
  {
    path: '/album',
    name: 'Album',
    component: () => import ('../views/Album/Album'),
    meta:{
      keepAlive:false
    },
  },
  // 用户页
  {
    path: '/profile',
    name: 'Profile',
    component: () => import ('../views/User/Profile'),
    meta:{
      keepAlive:true
    },
  },
 
  {
    path: '/myFM',
    name: 'MyFM',
    component: () => import ('../views/MyFM/MyFM'),
    meta:{
      keepAlive:true
    },
  },
  // 搜索列表
  {
    path:'/search',
    name:'Search',
    component:() => import ('../views/Search/Search'),
    redirect:'/search/songs',
    children:[
      {
        path:'/search/songs',
        name:'Songs',
        component:() => import ('../views/Search/childView/songs') ,
        meta:{
          keepAlive:false
        },
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
